/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package botlab.command;

import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;
import java.util.Random;

/**
 *
 * @author sebastien
 */
public class WanderCommand extends BaseCommand {

    private float maxSpeed;
    private Vector3f target;
    private Vector3f position;
    private Vector3f velocity;
    private Vector3f direction;

    public WanderCommand(Vector3f target, float maxSpeed) {
        this.target = target;
        this.maxSpeed = maxSpeed;

        velocity = new Vector3f();
        direction = new Vector3f();
    }

    public Vector3f wander() {
        Vector3f wander = new Vector3f(new Random().nextFloat(),
                new Random().nextFloat(),
                new Random().nextFloat());
        wander.normalize();

        Vector3f desiredTarget = new Vector3f();
        desiredTarget = position.add(wander);

        return desiredTarget;
    }

    @Override
    public void doCommand(Spatial spatial, float tpf) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
